First, we load the data.
# Read the happy moment data and keep only variables of interest.
hm_data <- read_csv("../output/processed_moments.csv") %>%
select(id, wid, reflection_period, cleaned_hm, num_sentence, norm_hm, text)
# Read the demographica data.
demo_data <- read_csv("../data/demographic.csv")
# Convert the age column to integer. It will give some NAs because some
# people are not willing to provide their age info.
demo_data$age <- as.integer(demo_data$age)
Now let’s take a look at the happy moment data.
datatable(hm_data)